// src/components/TopCard/index.tsx
import React from 'react';
import { View } from '@tarojs/components';
import './index.less';
interface AgreementContent {
  content: string;
}

const TopCard: React.FC<AgreementContent> = ({ content }) => {
  const genFormat = (content: string) => {
    const [title, contain] = content.split('|');
    return (
      <View className="flex flex-column" style={{ height: '100vh' }}>
        <View className="m-4 font-bold agreement-title" style={{ textAlign: 'center' }}>
          {title}
        </View>
        <View className="p-4 agreement-content" style={{ height: '85%', overflow: 'auto' }}>
          {contain.trim()}
        </View>
      </View>
    );
  };
  return genFormat(content);
};

export default TopCard;
